3.1.53 \(\int \csc ^2(a+b x) \csc (2 a+2 b x) \, dx\) [53]

Optimal. Leaf size=30 \[ -\frac {\cot ^2(a+b x)}{4 b}+\frac {\log (\tan (a+b x))}{2 b} \]

[Out]

-1/4*cot(b*x+a)^2/b+1/2*ln(tan(b*x+a))/b

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 30, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {4373, 2700, 14} \begin {gather*} \frac {\log (\tan (a+b x))}{2 b}-\frac {\cot ^2(a+b x)}{4 b} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Csc[a + b*x]^2*Csc[2*a + 2*b*x],x]

[Out]

-1/4*Cot[a + b*x]^2/b + Log[Tan[a + b*x]]/(2*b)

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 2700

Int[csc[(e_.) + (f_.)*(x_)]^(m_.)*sec[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> Dist[1/f, Subst[Int[(1 + x^2)^((
m + n)/2 - 1)/x^m, x], x, Tan[e + f*x]], x] /; FreeQ[{e, f}, x] && IntegersQ[m, n, (m + n)/2]

Rule 4373

Int[((f_.)*sin[(a_.) + (b_.)*(x_)])^(n_.)*sin[(c_.) + (d_.)*(x_)]^(p_.), x_Symbol] :> Dist[2^p/f^p, Int[Cos[a
+ b*x]^p*(f*Sin[a + b*x])^(n + p), x], x] /; FreeQ[{a, b, c, d, f, n}, x] && EqQ[b*c - a*d, 0] && EqQ[d/b, 2]
&& IntegerQ[p]

Rubi steps

\begin {align*} \int \csc ^2(a+b x) \csc (2 a+2 b x) \, dx &=\frac {1}{2} \int \csc ^3(a+b x) \sec (a+b x) \, dx\\ &=\frac {\text {Subst}\left (\int \frac {1+x^2}{x^3} \, dx,x,\tan (a+b x)\right )}{2 b}\\ &=\frac {\text {Subst}\left (\int \left (\frac {1}{x^3}+\frac {1}{x}\right ) \, dx,x,\tan (a+b x)\right )}{2 b}\\ &=-\frac {\cot ^2(a+b x)}{4 b}+\frac {\log (\tan (a+b x))}{2 b}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.06, size = 34, normalized size = 1.13 \begin {gather*} -\frac {\csc ^2(a+b x)+2 \log (\cos (a+b x))-2 \log (\sin (a+b x))}{4 b} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Csc[a + b*x]^2*Csc[2*a + 2*b*x],x]

[Out]

-1/4*(Csc[a + b*x]^2 + 2*Log[Cos[a + b*x]] - 2*Log[Sin[a + b*x]])/b

________________________________________________________________________________________

Maple [A]
time = 0.08, size = 24, normalized size = 0.80

method result size
default \(\frac {-\frac {1}{2 \sin \left (x b +a \right )^{2}}+\ln \left (\tan \left (x b +a \right )\right )}{2 b}\) \(24\)
risch \(\frac {{\mathrm e}^{2 i \left (x b +a \right )}}{b \left ({\mathrm e}^{2 i \left (x b +a \right )}-1\right )^{2}}+\frac {\ln \left ({\mathrm e}^{2 i \left (x b +a \right )}-1\right )}{2 b}-\frac {\ln \left ({\mathrm e}^{2 i \left (x b +a \right )}+1\right )}{2 b}\) \(62\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(b*x+a)^2*csc(2*b*x+2*a),x,method=_RETURNVERBOSE)

[Out]

1/2/b*(-1/2/sin(b*x+a)^2+ln(tan(b*x+a)))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 656 vs. \(2 (26) = 52\).
time = 0.29, size = 656, normalized size = 21.87 \begin {gather*} \frac {4 \, \cos \left (4 \, b x + 4 \, a\right ) \cos \left (2 \, b x + 2 \, a\right ) - 8 \, \cos \left (2 \, b x + 2 \, a\right )^{2} + {\left (2 \, {\left (2 \, \cos \left (2 \, b x + 2 \, a\right ) - 1\right )} \cos \left (4 \, b x + 4 \, a\right ) - \cos \left (4 \, b x + 4 \, a\right )^{2} - 4 \, \cos \left (2 \, b x + 2 \, a\right )^{2} - \sin \left (4 \, b x + 4 \, a\right )^{2} + 4 \, \sin \left (4 \, b x + 4 \, a\right ) \sin \left (2 \, b x + 2 \, a\right ) - 4 \, \sin \left (2 \, b x + 2 \, a\right )^{2} + 4 \, \cos \left (2 \, b x + 2 \, a\right ) - 1\right )} \log \left (\cos \left (2 \, b x\right )^{2} + 2 \, \cos \left (2 \, b x\right ) \cos \left (2 \, a\right ) + \cos \left (2 \, a\right )^{2} + \sin \left (2 \, b x\right )^{2} - 2 \, \sin \left (2 \, b x\right ) \sin \left (2 \, a\right ) + \sin \left (2 \, a\right )^{2}\right ) - {\left (2 \, {\left (2 \, \cos \left (2 \, b x + 2 \, a\right ) - 1\right )} \cos \left (4 \, b x + 4 \, a\right ) - \cos \left (4 \, b x + 4 \, a\right )^{2} - 4 \, \cos \left (2 \, b x + 2 \, a\right )^{2} - \sin \left (4 \, b x + 4 \, a\right )^{2} + 4 \, \sin \left (4 \, b x + 4 \, a\right ) \sin \left (2 \, b x + 2 \, a\right ) - 4 \, \sin \left (2 \, b x + 2 \, a\right )^{2} + 4 \, \cos \left (2 \, b x + 2 \, a\right ) - 1\right )} \log \left (\cos \left (b x\right )^{2} + 2 \, \cos \left (b x\right ) \cos \left (a\right ) + \cos \left (a\right )^{2} + \sin \left (b x\right )^{2} - 2 \, \sin \left (b x\right ) \sin \left (a\right ) + \sin \left (a\right )^{2}\right ) - {\left (2 \, {\left (2 \, \cos \left (2 \, b x + 2 \, a\right ) - 1\right )} \cos \left (4 \, b x + 4 \, a\right ) - \cos \left (4 \, b x + 4 \, a\right )^{2} - 4 \, \cos \left (2 \, b x + 2 \, a\right )^{2} - \sin \left (4 \, b x + 4 \, a\right )^{2} + 4 \, \sin \left (4 \, b x + 4 \, a\right ) \sin \left (2 \, b x + 2 \, a\right ) - 4 \, \sin \left (2 \, b x + 2 \, a\right )^{2} + 4 \, \cos \left (2 \, b x + 2 \, a\right ) - 1\right )} \log \left (\cos \left (b x\right )^{2} - 2 \, \cos \left (b x\right ) \cos \left (a\right ) + \cos \left (a\right )^{2} + \sin \left (b x\right )^{2} + 2 \, \sin \left (b x\right ) \sin \left (a\right ) + \sin \left (a\right )^{2}\right ) + 4 \, \sin \left (4 \, b x + 4 \, a\right ) \sin \left (2 \, b x + 2 \, a\right ) - 8 \, \sin \left (2 \, b x + 2 \, a\right )^{2} + 4 \, \cos \left (2 \, b x + 2 \, a\right )}{4 \, {\left (b \cos \left (4 \, b x + 4 \, a\right )^{2} + 4 \, b \cos \left (2 \, b x + 2 \, a\right )^{2} + b \sin \left (4 \, b x + 4 \, a\right )^{2} - 4 \, b \sin \left (4 \, b x + 4 \, a\right ) \sin \left (2 \, b x + 2 \, a\right ) + 4 \, b \sin \left (2 \, b x + 2 \, a\right )^{2} - 2 \, {\left (2 \, b \cos \left (2 \, b x + 2 \, a\right ) - b\right )} \cos \left (4 \, b x + 4 \, a\right ) - 4 \, b \cos \left (2 \, b x + 2 \, a\right ) + b\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(b*x+a)^2*csc(2*b*x+2*a),x, algorithm="maxima")

[Out]

1/4*(4*cos(4*b*x + 4*a)*cos(2*b*x + 2*a) - 8*cos(2*b*x + 2*a)^2 + (2*(2*cos(2*b*x + 2*a) - 1)*cos(4*b*x + 4*a)
 - cos(4*b*x + 4*a)^2 - 4*cos(2*b*x + 2*a)^2 - sin(4*b*x + 4*a)^2 + 4*sin(4*b*x + 4*a)*sin(2*b*x + 2*a) - 4*si
n(2*b*x + 2*a)^2 + 4*cos(2*b*x + 2*a) - 1)*log(cos(2*b*x)^2 + 2*cos(2*b*x)*cos(2*a) + cos(2*a)^2 + sin(2*b*x)^
2 - 2*sin(2*b*x)*sin(2*a) + sin(2*a)^2) - (2*(2*cos(2*b*x + 2*a) - 1)*cos(4*b*x + 4*a) - cos(4*b*x + 4*a)^2 -
4*cos(2*b*x + 2*a)^2 - sin(4*b*x + 4*a)^2 + 4*sin(4*b*x + 4*a)*sin(2*b*x + 2*a) - 4*sin(2*b*x + 2*a)^2 + 4*cos
(2*b*x + 2*a) - 1)*log(cos(b*x)^2 + 2*cos(b*x)*cos(a) + cos(a)^2 + sin(b*x)^2 - 2*sin(b*x)*sin(a) + sin(a)^2)
- (2*(2*cos(2*b*x + 2*a) - 1)*cos(4*b*x + 4*a) - cos(4*b*x + 4*a)^2 - 4*cos(2*b*x + 2*a)^2 - sin(4*b*x + 4*a)^
2 + 4*sin(4*b*x + 4*a)*sin(2*b*x + 2*a) - 4*sin(2*b*x + 2*a)^2 + 4*cos(2*b*x + 2*a) - 1)*log(cos(b*x)^2 - 2*co
s(b*x)*cos(a) + cos(a)^2 + sin(b*x)^2 + 2*sin(b*x)*sin(a) + sin(a)^2) + 4*sin(4*b*x + 4*a)*sin(2*b*x + 2*a) -
8*sin(2*b*x + 2*a)^2 + 4*cos(2*b*x + 2*a))/(b*cos(4*b*x + 4*a)^2 + 4*b*cos(2*b*x + 2*a)^2 + b*sin(4*b*x + 4*a)
^2 - 4*b*sin(4*b*x + 4*a)*sin(2*b*x + 2*a) + 4*b*sin(2*b*x + 2*a)^2 - 2*(2*b*cos(2*b*x + 2*a) - b)*cos(4*b*x +
 4*a) - 4*b*cos(2*b*x + 2*a) + b)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 65 vs. \(2 (26) = 52\).
time = 4.32, size = 65, normalized size = 2.17 \begin {gather*} -\frac {{\left (\cos \left (b x + a\right )^{2} - 1\right )} \log \left (\cos \left (b x + a\right )^{2}\right ) - {\left (\cos \left (b x + a\right )^{2} - 1\right )} \log \left (-\frac {1}{4} \, \cos \left (b x + a\right )^{2} + \frac {1}{4}\right ) - 1}{4 \, {\left (b \cos \left (b x + a\right )^{2} - b\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(b*x+a)^2*csc(2*b*x+2*a),x, algorithm="fricas")

[Out]

-1/4*((cos(b*x + a)^2 - 1)*log(cos(b*x + a)^2) - (cos(b*x + a)^2 - 1)*log(-1/4*cos(b*x + a)^2 + 1/4) - 1)/(b*c
os(b*x + a)^2 - b)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \csc ^{2}{\left (a + b x \right )} \csc {\left (2 a + 2 b x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(b*x+a)**2*csc(2*b*x+2*a),x)

[Out]

Integral(csc(a + b*x)**2*csc(2*a + 2*b*x), x)

________________________________________________________________________________________

Giac [A]
time = 0.43, size = 37, normalized size = 1.23 \begin {gather*} -\frac {\frac {1}{\sin \left (b x + a\right )^{2}} + \log \left (-\sin \left (b x + a\right )^{2} + 1\right ) - 2 \, \log \left ({\left | \sin \left (b x + a\right ) \right |}\right )}{4 \, b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(b*x+a)^2*csc(2*b*x+2*a),x, algorithm="giac")

[Out]

-1/4*(1/sin(b*x + a)^2 + log(-sin(b*x + a)^2 + 1) - 2*log(abs(sin(b*x + a))))/b

________________________________________________________________________________________

Mupad [B]
time = 0.14, size = 36, normalized size = 1.20 \begin {gather*} -\frac {\frac {\ln \left (\cos \left (a+b\,x\right )\right )}{2}-\frac {\ln \left ({\sin \left (a+b\,x\right )}^2\right )}{4}+\frac {1}{4\,{\sin \left (a+b\,x\right )}^2}}{b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(sin(a + b*x)^2*sin(2*a + 2*b*x)),x)

[Out]

-(log(cos(a + b*x))/2 - log(sin(a + b*x)^2)/4 + 1/(4*sin(a + b*x)^2))/b

________________________________________________________________________________________